<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <!--    <HelloWorld msg="Welcome to Your Vue.js App"/>-->
    <h2>根组件 {{$store.state.key}}</h2>
    <!--    <h2>根组件 100</h2>-->
    <input :value="$store.state.key" @input="$store.commit('updateKey', $event.target.value)"/>
    <Son1></Son1>
    <Son2></Son2>
  </div>
</template>

<script>
// @ is an alias to /src
// import HelloWorld from '@/components/HelloWorld.vue'
import Son1 from '@/components/Son1'
import Son2 from '@/components/Son2'
import store from '@/store'

export default {
  name: 'HomeView',
  components: {
    // HelloWorld
    Son1,
    Son2
  },
  created () {
    console.log(this.$store.state.key)
    console.log(store.state.key)
  }
}
</script>

<style scoped>

</style>
